package demo.kafka.streams.cfg;

import org.apache.kafka.streams.KafkaStreams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.kafka.config.StreamsBuilderFactoryBean;
import org.springframework.stereotype.Component;

@Component
public class ConfigValidator implements ApplicationListener<ApplicationReadyEvent> {

    private static final Logger logger = LoggerFactory.getLogger(ConfigValidator.class);

//    @Autowired
    private StreamsBuilderFactoryBean factoryBean;

    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        logger.info("onApplicationEvent: {}",event);
//        KafkaStreams kafkaStreams = factoryBean.getKafkaStreams();
//        System.out.println("Kafka Streams配置:");
    }
}
